﻿@model AutomatedTestDataManagement.Models.PagesField

@{
    ViewBag.Title = "Create";
}

<h2>Add Field to Page</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>PagesField</legend>


        <div class="editor-label">
            @Html.LabelFor(model => model.PageID, "Page")
        </div>
        <div class="editor-field">
            @if (ViewBag.SiteID != null)
            {
                <input type="hidden" name="SiteID" id="SiteID" value="@ViewBag.SiteID" />
            }
            @Html.DropDownList("PageID", String.Empty)
            @Html.ValidationMessageFor(model => model.PageID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FieldID, "Field")
        </div>
        <div class="editor-field">
            @Html.DropDownList("FieldID", String.Empty)
            @Html.ValidationMessageFor(model => model.FieldID)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>


<div>
    @if(ViewBag.SiteID != null)
    {
        @Html.ActionLink("Return to Page", "Edit", "Page", new { id = ViewBag.SelectedPageID , siteID = ViewBag.SiteID }, null) Html.Encode(" | ");
        @Html.ActionLink("Add new Field", "Create", "HTMLField", new { id = ViewBag.SelectedPageID, siteID = ViewBag.SiteID }, null)
    }
    else
    {
        @Html.ActionLink("Add new Field", "Create", "HTMLField", new { id = ViewBag.SelectedPageID }, null)
        @Html.ActionLink("Return to Page", "Edit", "Page", new { id = ViewBag.SelectedPageID }, null) Html.Encode(" | ");
    }

    <div>
        @Html.Partial("_NavigationManagementNav")
    </div>
</div>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
